#include "link/include/factory.h"
int main()
{
    printf("Compiled on %s at %s\n",__DATE__,__TIME__);//准确说是main.c文件编译的时间
    int sockfd;
    factory_t fac;
    server_init(&sockfd,&fac);
    int newfd;
    pnode_t pnewnod;
    pque_t pque=&fac.que;
    while(1)
    {//这里只需要建立连接即可，不拿客户端地址
        newfd=accept(sockfd,NULL,NULL);
        pnewnod=(pnode_t)calloc(1,sizeof(node_t));
        pnewnod->newfd=newfd;
        pthread_mutex_lock(&pque->q_mutex);
        que_set(pque,pnewnod);
        pthread_mutex_unlock(&pque->q_mutex);
        pthread_cond_signal(&fac.cond);
    }
    mysql_close(fac.conn);
    return 0;
}
